<div class="container">
    <h4>Quản trị website</h4>
</div>
<div class="container" style="margin-bottom: -1px;" >
    <div style="margin-top: 10px" >
        <ul class="nav nav-tabs nav-collapse">
            <li class="active">
                <a href="cp/site.html">Danh sách domain</a>
            </li>
        </ul>
    </div>      
</div>    
<div class="container" style="border: 1px solid #ccc;" >
    <form method="GET" action="<?= $this->baseUrl ?>cp/site.html" id="search" class="form-vertical" style="margin-top: 20px;" >
        <div class="col-md-4">
            <div class="form-group ">
                <input class="form-control" name="domain" value="<?= @$search->domain ?>" placeholder="Nhập domain" />
            </div>
        </div>
        <div class="col-md-4">
            <div class="form-group ">
                <input class="form-control" name="email" value="<?= @$search->email ?>" placeholder="Nhập địa chỉ email" />
            </div>
        </div>
        <div class="col-md-4">
            <div class="form-group ">
                <select name="nofollow" class="form-control" >
                    <option value="0" >--Trạng thái nofollow--</option>
                    <option value="1" <?= @$search->nofollow == 1 ? 'selected' : '' ?> >Nofollow</option>
                    <option value="2" <?= @$search->nofollow != 1 && @$search->nofollow > 0 ? 'selected' : '' ?> >Dofollow</option>
                </select>
            </div>
        </div>
        <div class="col-md-4">
            <div class="form-group ">
                <button type="button" onclick="btnSearch('search');" class="btn btn-info">
                    <i class="glyphicon glyphicon-search"></i> Lọc thông tin
                </button>
                <button type="button" onclick="btnReset('search');" class="btn btn-default">
                    <i class="glyphicon glyphicon-list"></i> Tất cả
                </button>
            </div>
        </div>
    </form>
    <p class="clearfix" ></p>
    <div style="margin-top: 10px;">
        <h5 class="pull-left alert alert-success" style="padding: 10px; width: 33%;" >
            Tìm thấy tổng số 
            <span style="color: tomato; font-weight: bolder"><?= $dataPage->dataCount ?></span> 
            người dùng trong 
            <span style="color: tomato; font-weight: bolder"><?= $dataPage->pageCount ?></span> trang.
        </h5>
        <div class="btn-toolbar pull-right" style="padding: 15px 0px;">
            <?= $this->loadView('/widget/page'); ?>
        </div>
    </div>
    <table  class="table table-striped table-bordered table-responsive" style="margin-bottom: 10px;" >
        <thead>
            <tr class="success" >
                <th class="text-center">Mã</th>
                <th class="text-center">Domain</th>
                <th class="text-center">Email</th>
                <th class="text-center">
                    Nofollow
                    <i class="glyphicon glyphicon-edit pull-right"></i>
                </th>                           
                <th class="text-center">Thao tác</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($dataPage->data as $item) { ?>
                <tr>
                    <td class="text-center" style="vertical-align: middle" ><?= @$item->id ?></td>
                    <td class="text-center" style="vertical-align: middle" ><?= @$item->domain ?></td>
                    <td class="text-center" style="vertical-align: middle" ><?= @$item->email ?></td>
                    <td class="text-center" style="vertical-align: middle" for="nofollow_<?= @$item->id ?>" >
                        <?= @$item->nofollow ? '<label class="label label-success">nofollow</label>' : '<label class="label label-danger">dofollow</label>' ?>
                        <i onclick="site.changeNofollow(<?= @$item->id ?>);" style="cursor: pointer" class="glyphicon glyphicon-<?= @$item->nofollow ? 'check' : 'unchecked' ?> pull-right"></i>
                    </td>
                    <td class="text-center" style="vertical-align: middle" >
                        <div class="btn-group">
                            <button type="button" class="btn btn-danger" onclick="site.remove('<?= @$item->id ?>');" >
                                <i class="glyphicon glyphicon-remove"></i> Xóa
                            </button>
                        </div>
                    </td>
                </tr>
            <?php } ?>
        </tbody>
    </table>
    <div class="btn-toolbar pull-right" style="padding: 15px 0px;">
        <?= $this->loadView('/widget/page'); ?>
    </div>
    <p class="clearfix" ></p>
</div>